﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Layout/SiteNoHead.master"
	AutoEventWireup="true" CodeBehind="EditNew.aspx.cs" Inherits="FOBTV.Web.Admin.Pages.EditNew" %>

<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	新闻编辑
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
	<base target="_self" />
	<script type="text/javascript">
		function checkInput()
		{
			var newsTitle = $("#<%=txtNewsTitle.ClientID %>").val().replace(' ', '');
			var index = $("#<%=txtIndex.ClientID %>").val().replace(' ', '');
			var newsCategory = $("#<%=ddlNewsCategory.ClientID %>").val().replace(' ', '');
			var errorLbl = $("#<%=LblError.ClientID %>");
			if (newsTitle == '')
			{
				errorLbl.html("<font color='red'>新闻标题不能为空！</font>");
				return false;
			} else if (index == '')
			{
				errorLbl.html("<font color='red'>权重排序不能为空！</font>");
				return false;
			} else if (newsCategory == '')
			{
				errorLbl.html("<font color='red'>新闻分类不能为空！</font>");
				return false;
			}

			var re = /^[0-9]*[1-9][0-9]*$/   //判断字符串是否为数字     //判断正整数 /^[1-9]+[0-9]*]*$/

			if (!re.test(index))
			{
				errorLbl.html("<font color='red'>权重排序必须为整数！</font>");
				return false;
			}
			return true;
		}
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="SubTitle" runat="server">
	新闻编辑
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="MainContent" runat="server">
	<asp:Button runat="server" CssClass="button" Text="发布" OnClientClick="return checkInput();"
		ID="Button1" OnClick="BtnEditArticle_Click" />
	<table class="news_table" border="1">
		<thead>
			<tr>
				<th>
					新闻标题：
				</th>
				<td>
					<asp:TextBox CssClass="newstxt" MaxLength="80" ID="txtNewsTitle" runat="server"></asp:TextBox>
					<span class="red">*</span>
					<asp:Label ID="LblError" runat="server"></asp:Label>
				</td>
			</tr>
		</thead>
		<tbody>
			<tr>
				<th>
					栏目名称：
				</th>
				<td>
					<asp:DropDownList ID="ddlType" runat="server">
						<asp:ListItem Text="中心动态" Value="中心动态" Selected="True"></asp:ListItem>
						<asp:ListItem Text="行业资讯" Value="行业资讯"></asp:ListItem>
					</asp:DropDownList>
				</td>
			</tr>
			<tr>
				<th>
					新闻来源：
				</th>
				<td>
					<asp:TextBox CssClass="newstxt" ID="txtNewsSource" runat="server"></asp:TextBox>
				</td>
			</tr>
			<tr>
				<th>
					发布者：
				</th>
				<td>
					<asp:TextBox CssClass="newstxt" ReadOnly="true" ID="txtPublisher" runat="server"></asp:TextBox>
					<span class="red">*</span>
				</td>
			</tr>
			<tr>
				<th>
					新闻：
				</th>
				<td>
					<CKEditor:CKEditorControl id="txtNewsContent" runat="server">
					</CKEditor:CKEditorControl>
				</td>
			</tr>
			<tr>
				<th>
					信息属性:
				</th>
				<td>
					<asp:CheckBox ID="ckbIsRecommend" runat="server" Text="首页推荐"/>
					<span class="red">*</span>
				</td>
			</tr>
			<tr>
				<th>
					权重排序：
				</th>
				<td>
					<asp:TextBox CssClass="newstxt" ID="txtIndex" runat="server"></asp:TextBox>
				</td>
			</tr>
			
			<tr>
				<th>
					新闻分类：
				</th>
				<td>
					<asp:DropDownList ID="ddlNewsCategory" runat="server">
						<asp:ListItem Text="2011" Value="2011" Selected="True"></asp:ListItem>
						<asp:ListItem Text="2012" Value="2012"></asp:ListItem>
						<asp:ListItem Text="2013" Value="2013"></asp:ListItem>
						<asp:ListItem Text="2014" Value="2014"></asp:ListItem>
					</asp:DropDownList>
				</td>
			</tr>
			<tr>
				<th>
					发布：
				</th>
				<td>
					<asp:Button runat="server" CssClass="button" OnClientClick="return checkInput();"
						Text="发布" ID="BtnEditArticle" OnClick="BtnEditArticle_Click" />
				</td>
			</tr>
		</tbody>
	</table>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="MainBody" runat="server">
</asp:Content>
